/*
 * Copyright 2008-2009 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package egovframework.rte.sample.service.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
import egovframework.rte.sample.service.DatabaseDefaultVO;
import egovframework.rte.sample.service.DatabaseVO;
import egovframework.rte.sample.service.StudyUsersVO;

@Repository("AllStudyUsersDAO")
public class AllStudyUsersDAO extends EgovAbstractDAO {

	/**
	 * 글을 등록한다.
	 * @param vo - 등록할 정보가 담긴 SampleVO
	 * @return 등록 결과
	 * @exception Exception
	 */
    public String insertStudyUsers(StudyUsersVO vo) throws Exception {
        return (String)insert("studyUsersDAO.insert", vo);
    }

    /**
	 * 글을 수정한다.
	 * @param vo - 수정할 정보가 담긴 SampleVO
	 * @return void형
	 * @exception Exception
	 */
    public void updateStudyUsers(StudyUsersVO vo) throws Exception {
        update("studyUsersDAO.update", vo);
    }

    /**
	 * 글을 삭제한다.
	 * @param vo - 삭제할 정보가 담긴 SampleVO
	 * @return void형 
	 * @exception Exception
	 */
    public void deleteStudyUsers(StudyUsersVO vo) throws Exception {
        delete("studyUsersDAO.delete", vo);
    }

    /**
	 * 글을 조회한다.
	 * @param vo - 조회할 정보가 담긴 SampleVO
	 * @return 조회한 글
	 * @exception Exception
	 */
    public DatabaseVO selectStudyUsers(StudyUsersVO vo) throws Exception {
        return (DatabaseVO) selectByPk("studyUsersDAO.select", vo);
    }

    /**
	 * 글 목록을 조회한다.
	 * @param searchMap - 조회할 정보가 담긴 Map
	 * @return 글 목록
	 * @exception Exception
	 */
    public List selectStudyUsersList(DatabaseDefaultVO searchVO) throws Exception {
        return list("studyUsersDAO.selectSearch", searchVO);
    }

    /**
	 * 글 총 갯수를 조회한다.
	 * @param searchMap - 조회할 정보가 담긴 Map
	 * @return 글 총 갯수
	 * @exception
	 */
    public int selectStudyUsersListTotCnt(DatabaseDefaultVO searchVO) {
        return (Integer)getSqlMapClientTemplate().queryForObject("studyUsersDAO.selectTotCnt", searchVO);
    }

}
